<?php 

if(!defined('ADMIN')){
	exit('Access Denied');
}
?>

<div class="pageHeader">
	<p class="topnam"><b>会员卡管理 > 会员卡列表</b></p>
</div>
<form id="pagerForm" method="post" action="#rel#">
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="<?=u(MOD,'cardlist',array('q'=>$q,'status'=>$status))?>" method="post">
	<div class="searchBar">
		<ul class="searchContent">
        <table class="searchContent">
        <tr><td>查询：<input type="text" name="q" value="<?=$q?>" /></td>
        <td><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></td>
        </tr>
        </table>
	</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<?=u(MOD,'addedicard')?>" rel="magaz" target="dialog" width="550" height="330" title="新增会员卡"><span>新增会员卡</span></a></li>
            <li><a title="确实要删除选择的内容吗?" target="selectedTodo" rel="ids[]" href="<?=u(MOD,'delcard')?>" class="delete"><span>批量删除</span></a></li>
            <li><a class="add" href="<?=u(MOD,'addedicardlist')?>" rel="magaz" target="dialog" width="550" height="330" title="批量导入会员卡"><span>批量导入</span></a></li>
                        
		</ul>
	</div>
<form method="post" action="<?=u(MOD,'cardlist')?>&id=<?=$id?>" rel="pagerForm"  onsubmit="return navTabSearch(this);">
<input type="hidden" name="sub" value="save" />
	<table class="table" width="100%" layoutH="148">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
				<th width="50" class="center" orderField="id" <? if($orderField=="id"){?>class="<?=$orderDirection?>"<?}?>>ID</th>
				<th width="150" class="center">卡号</th>
                <th width="150" class="center">激活时间</th>
                <th width="100" class="center">状态</th>
				<th width="150" class="center">操作</th>
			</tr>
		</thead>
        <tbody>
        <?php foreach ($row as $r){?>
		<tr target="id" rel="<?=$r["id"]?>" style="height: 50px;line-height: 50px;">
				<td class="center"><input name="ids[]" value="<?=$r["id"]?>" type="checkbox" /></td>
				<td class="center"><?=$r["id"]?></td>
                                <td class="center"><?=$r["cardno"]?></td>
                <td class="center"><?
                if($r["utime"]>0){
                    echo date("Y-m-d H:i:s",$r["utime"]);
                }else{
                    echo "-";
                }
                ?></td>               
                <td class="center"><?
                if($r["status"]==0){
                    echo "有效";
                }else{
                    echo "锁定";
                }
                ?></td>
				<td class="center">
<a title="删除？" target="ajaxTodo" href="<?=u(MOD,'delcard',array('id'=>$r['id']))?>" class="btnDel">删除</a>

				</td>
		</tr>
        <?php }?>   
		</tbody>
	</table>            
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})" id="PageSize">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>" pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>

</form>      
</div>    
